package com.myronmarston.music;

import com.myronmarston.music.settings.FractalPiece;
import com.myronmarston.music.settings.Voice;

public class AMFMPieceCreator {

  public static void main(String[] args) {

    try {

      FractalPiece[] fractalPieces = new FractalPiece[2];
      FractalPiece fp = new FractalPiece();
      Voice v = fp.createVoice();
      v.setInstrumentName("Flute");
      fp.createSection();
      fp.setGermString("F4 G4 C5 Bb4");

      fractalPieces[0] = fp;

      final FractalPiece fp2 = new FractalPiece();
      Voice v2 = fp2.createVoice();
      v2.setInstrumentName(Instrument.DEFAULT.getName());
      fp2.createSection();
      fp2.setGermString("A6,1/8 B6,1/16 C6 E6,1/4 C6 E6");

      fractalPieces[1] = fp2;

      AMFMOutputManager outputManager = new AMFMOutputManager(fractalPieces);
      outputManager.saveWavFile("test.wav");

      System.out.println("done");

    } catch (Exception e) {

      System.err.println("ooohhhhh crrraaaaaappppp");
      System.err.println(e.toString());

    }

  }

}
